//related to header1.ui
var root = ui("$");// 或者var root = ui("root");

var nf = sm("do_Notification");

var app = sm('do_App');
var page = sm("do_Page");



var gridData = mm("do_ListData");

page.on('back',function(){
	app.closePage();
})
 

//组件列表
 var listdata = mm("do_ListData");
//定义listview界面
var listView = ui("do_ListView_coupons");
var do_Button_confirm = ui("do_Button_confirm");
//绑定数据
listView.bindItems(listdata);
//需要Cell对应的模板UI文件组
listView.templates="source://view/tradingdetails/coupons.ui";
//调用initdata 组件，读取本地的json 数据
var initdata = sm("do_InitData");

initdata.readFile("initdata://coupons.json",function(data){
	//将数据添加到组件中
	listdata.addData(data);
	listView.refreshItems();
	
});
//上下滑动，恢复headerview和footerview
listView.rebound();



do_Button_confirm.on("touch", function() {
	app.openPage("source://view/tradingdetails/payment.ui");
})
  
/*****页面标题*****/
root.setMapping({
	// ui的id.ui.属性：绑定到一个变量
	"header_title.text" : "header_title",
})